def InitStack():
    return []


def Push(stack, element):
    stack.append(element)


def Pop(stack):
    if not stack:
        print("栈为空，无法出栈。")
        return None
    return stack.pop()


def GetTop(stack):
    if not stack:
        print("栈为空，无栈顶元素。")
        return None
    return stack[-1]


# 测试代码
if __name__ == "__main__":
    stack = InitStack()
    Push(stack, 1)
    Push(stack, 2)
    Push(stack, 3)
    print("栈顶元素:", GetTop(stack))
    popped = Pop(stack)
    print("出栈元素:", popped)
    print("栈顶元素:", GetTop(stack))
